const initialState = {
    num: 1,
}

const classifyModel = {
    namespace: 'classify',
    state: initialState,
    reducers: {
        setState(state , { payload }) {
            return {
                ...state,
                ...payload
            }
        }
    },
    effects: {
        *asyncAdd({callback, payload},  { call, put, select }) { 
            let  {num}  = yield select(state => state.classify)
            let count = num + 5
            payload.num += 5;
            yield put({
                type: 'setState',
                payload: {
                    num: count
                }
            })
        }
    }
}

export default classifyModel;